package com.javasm.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.javasm.domin.entity.AftersaleEnterDepotDetail;
import com.javasm.mapper.base.MyMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author：longjinyi
 * @Version：1.0
 * @Date：2022/1/20-17:39
 * @Since:jdk1.8
 * @Description:
 */
public interface AftersaleEnterDepotDetailMapper extends MyMapper<AftersaleEnterDepotDetail> {

    String querySql = "select gg.goods_id,gg.goods_name,gg.type_id,aet.sn_code,aod.out_sn,aod.sn_ischange,aod.out_type \n" +
            "from aftersale_enter_test aet , gd_goods gg , aftersale_out_depot aod , aftersale_enter_depot aed \n" +
            "where aet.goods_id=gg.goods_id and aet.number=aed.id and aed.out_id=aod.id";

    String wrapperSql = "SELECT * from ( " + querySql + " ) AS q ${ew.customSqlSegment}";

    @Select(wrapperSql)
    List<AftersaleEnterDepotDetail> list(@Param("ew") Wrapper queryWrapper);
}
